<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function main(g) {
				
				if(isNaN(g)) {
					document.write("不是数字不符合条件");
				} else {
					var s = 0;
					if(g > 20000)
						s = (g - 20000) * 0.1 + 12000 * 0.05 + 4500 * 0.02;
					else {
						if(g > 3500 && g <= 8000)
							s = 4500 * 0.02;
						else if(g > 8000 && g <= 20000)
							s = (g - 8000) * 0.05 + 4500 * 0.02;
						else if(g <= 3500)
							s = 0;
					}
					document.write("应交个税为" + s);
				}
			}

			
		</script>
	</head>

	<body>
		<input type="button" value="专门计算您的工资！！！按下" onclick="main(prompt('请输入您的工资：', ''))"/>
	</body>

</html>